package cn.community.care.module.system.dal.mysql.activities;

import java.util.*;

import cn.community.care.framework.common.pojo.PageResult;
import cn.community.care.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.community.care.framework.mybatis.core.mapper.BaseMapperX;
import cn.community.care.module.system.dal.dataobject.activities.ActivitiesDO;
import org.apache.ibatis.annotations.Mapper;
import cn.community.care.module.system.controller.admin.activities.vo.*;

/**
 * 活动信息 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface ActivitiesMapper extends BaseMapperX<ActivitiesDO> {

    default PageResult<ActivitiesDO> selectPage(ActivitiesPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ActivitiesDO>()
                .eqIfPresent(ActivitiesDO::getTitle, reqVO.getTitle())
                .eqIfPresent(ActivitiesDO::getContent, reqVO.getContent())
                .eqIfPresent(ActivitiesDO::getCoverUrl, reqVO.getCoverUrl())
                .orderByDesc(ActivitiesDO::getId));
    }

}